package org.microblog;

import org.microblog.entity.User;
import org.microblog.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.sql.SQLException;

/**
 * @Description TODO
 * @Author hyl
 * @Date 2022/3/24 8:41
 **/
public class Test {
	public static void main(String[] args) throws SQLException {
//		try {
//			UserDao userDao = new UserDaoImpl(DatabaseUtil.getConnection());
//			User user = userDao.findUser("15210085665", "123456");
//			System.out.println(user);
//		} catch (SQLException throwables) {
//			throwables.printStackTrace();
//		}
		ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
		UserService dao= (UserService) context.getBean("userService");
		User list=dao.findUser("15210085665", "123456");
		System.out.println(list.getName());
	}


}
